<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8' />
    <title>Mapbox GL Inspect</title>
    <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
    <script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.33.0/mapbox-gl.js'></script>
    <link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.33.0/mapbox-gl.css' rel='stylesheet' />
    <script src='/dist/mapbox-gl-inspect.js'></script>
    <link href='/dist/mapbox-gl-inspect.css' rel='stylesheet' />
    <style>
        body { margin:0; padding:0; }
        #map { position:absolute; top:0; bottom:0; width:100%; }
    </style>
</head>
<body>

<div id='map'></div>
<script>
mapboxgl.accessToken = 'pk.eyJ1IjoibW9yZ2Vua2FmZmVlIiwiYSI6IjIzcmN0NlkifQ.0LRTNgCc-envt9d5MzR75w';
var map = new mapboxgl.Map({
    container: 'map',
    style: 'mapbox://styles/mapbox/bright-v9',
    center: [-74.50, 40],
    zoom: 3,
    hash: true
});
map.addControl(new mapboxgl.NavigationControl());
map.addControl(new MapboxInspect({
  showInspectMap: true,
  backgroundColor: '#000',
  assignLayerColor: function generateColor(str) {
    var rgb = [0, 0, 0];
    for (var i = 0; i < str.length; i++) {
        var v = str.charCodeAt(i);
        rgb[v % 3] = (rgb[i % 3] + (13*(v%13))) % 12;
    }
    var r = 4 + rgb[0];
    var g = 4 + rgb[1];
    var b = 4 + rgb[2];
    r = (r * 16) + r;
    g = (g * 16) + g;
    b = (b * 16) + b;
    return 'rgba(' + [r, g, b, 1].join(',') + ')';
  }
}));
</script>

</body>
</html>
